Skip to content

Conversation

hawkadrian
Copy link

Create RpcCommonOpts to share RPC-related fields between RpcOpts and EvmArgs,
resolving serialization conflicts and making the structures compatible.

Fixes #11962

Copy link
Contributor

@mablr mablr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I didn’t expect someone else to propose a PR on this ahead of me. 😅

I’ve added a remark about the scope. This was the initial topic of discussion I wanted to open with #11962.

#[arg(long, value_name = "NO_RATE_LIMITS", visible_alias = "no-rate-limit")]
#[serde(skip)]
pub no_rpc_rate_limit: bool,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we do want url, accept_invalid_certs and rpc_timeout in EvmArgs, I'm not sure the other fields are needed/relevant ...

@hawkadrian hawkadrian requested a review from mablr October 5, 2025 15:53
@hawkadrian
Copy link
Author

hawkadrian commented Oct 5, 2025

@mablr thanks for your review, really appreciate it!

I've made changes, did you mean something like this?

Copy link
Contributor

@mablr mablr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yes for the new struct you added. Then deduplicate...

Don't forget that you added new fields to EvmArgs, they must be applied to the provider config spawned when using a command with evm args like forge script (this may help: #11960 (review))


/// Limited RPC options for EVM-related commands that only need basic RPC functionality.
#[derive(Clone, Debug, Default, Serialize, Parser)]
pub struct EvmRpcOpts {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should actually be what you called RpcCommonOpts.

Then you could integrate this 3-field struct to both RpcOpts/EvmArgs.


/// Common RPC-related options that can be shared across different CLI commands.
#[derive(Clone, Debug, Default, Serialize, Parser)]
pub struct RpcCommonOpts {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may remove this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Refactor/unify the common fields in RpcOpts and EvmArgs
2 participants